Public Class FormMain

    Private Sub FormMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'Hide inherits control
        Me.lblMinimize.Show()
        btnAdd.Hide()
        btnDelete.Hide()
        btnUpdate.Hide()
        txtSearch.Hide()
        'show form login
        Dim frm = New FormLogin()
        frm.ShowDialog()

        Me.lblUser.Text = App.UserFullName
        'Assign Application pemission level
        Me.menuManage.Enabled = App.IsAuthorized(Permissions.Manage)
        Me.menuEmployee.Enabled = App.IsAuthorized(Permissions.Manage_Employee)
        Me.menuEducation.Enabled = App.IsAuthorized(Permissions.Manage_Education)
        Me.menuExperience.Enabled = App.IsAuthorized(Permissions.Manage_Experience)
        Me.menuFamilies.Enabled = App.IsAuthorized(Permissions.Manage_Family)
        Me.menuDepartment.Enabled = App.IsAuthorized(Permissions.Manage_Department)
        Me.menuPosition.Enabled = App.IsAuthorized(Permissions.Manage_permission)
        Me.menuLeaveTime.Enabled = App.IsAuthorized(Permissions.Manage_LeaveTime)
        Me.menuResign.Enabled = App.IsAuthorized(Permissions.Manage_Resign)
        Me.menuAccident.Enabled = App.IsAuthorized(Permissions.Manage_Accident)
        Me.menuInsurance.Enabled = App.IsAuthorized(Permissions.Manage_Insurance)
        Me.menuWarning.Enabled = App.IsAuthorized(Permissions.Manage_Warning)
        Me.menuWorkPerformance.Enabled = App.IsAuthorized(Permissions.Manage_WorkPerformance)

        Me.TrainingMenu.Enabled = App.IsAuthorized(Permissions.Training)
        Me.menuCompanyTraining.Enabled = App.IsAuthorized(Permissions.Training_CompanyTraining)
        Me.menuTrainee.Enabled = App.IsAuthorized(Permissions.Training_Trainee)
        Me.menuTraineeExperience.Enabled = App.IsAuthorized(Permissions.Training_Trainee_Experience)
        Me.menuTraineeEducation.Enabled = App.IsAuthorized(Permissions.Training_Trainee_Education)
        Me.menuTraineeFamilies.Enabled = App.IsAuthorized(Permissions.Training_Trainee_Family)
        Me.MenuSkill.Enabled = App.IsAuthorized(Permissions.Training_Skill)


    End Sub
End Class